package com.jaws.core.compatible.initialize;

import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.event.ContextRefreshedEvent;
import org.springframework.stereotype.Component;

import com.jaws.core.compatible.util.HttpUtil;

/**
 * 内置sni开启
 * @author maojian
 * @date 2018-01-22 15:01:47
 * @since v1.0.0
 */
@Component
public class HttpInitializer extends Initializer{


	@Value("${jaws.http.sni:true}")
	protected String httpSNI;
	
	@Override
	public int getOrder() {
		return -1;
	}

	@Override
	public void initialize(ContextRefreshedEvent event) {
		if(StringUtils.isNoneBlank(httpSNI)){
			HttpUtil.setSNI(httpSNI);
		}
	}

}
